<template>
  <div class="edu-page-warp">
    <el-card shadow="never">
      <el-row type="flex" justify="space-between" class="con_title">
        <el-col :span="6">
          <div class="edu-page-title">{{$t('preDefense.auditMessage')}}</div>
        </el-col>
        <el-col :span="3" style="text-align: right;">
          <el-button @click="back">{{$t('message.return')}}</el-button>
        </el-col>
      </el-row>
      <inputOption :row="row" :options="options" :editFlag="true" :detailsFlag="false"></inputOption>
    </el-card>
    <el-card shadow="never">
      <auditProgressInfo :data="auditList"></auditProgressInfo>
    </el-card>
  </div>
</template>
<script>
  import inputOption from 'common/src/views/preDefense/preDefenseApply/inputOption';
  import auditProgressInfo from '../common/auditProgressInfo';
  import {approvelDetail} from "common/src/api/approval";
export default {
    components: {
      inputOption,
      auditProgressInfo
    },
    mixins: [],
    props: {
      row: {
        type: Object,
        default: {}
      },
      options: {
        type: Object,
        default: {}
      },
    },
    data() {
        return {
          auditList: []
        };
    },
    computed: {

    },
    created() {

    },
    mounted() {
      this.getApprovelDetail();
    },
    methods: {
        open(type, row) {
            this.$emit('emit:click', { type: type, row: row });
        },
        back() {
            this.$emit('emit:back');
        },
        // 获取审批记录
        getApprovelDetail () {
          if (!this.row.workFlowId || this.row.workFlowId === '') {
            return;
          }
          let param = {
            no: this.row.workFlowId
          };
          approvelDetail(param).then(res => {
            if (res && res.data) {
              this.auditList = res.data.listApproveHistory;
            }
          });
        },
    }
};
</script>

<style scoped lang="scss">
.con {
    background-color: white;
    padding: 20px;
    &_title {
        width: 100%;
        border-bottom: solid #ccc 2px;
        padding-bottom: 20px;
    }
    &_footer {
        display: flex;
        flex-direction: row-reverse;
        border-top: solid #ccc 1px;
        padding-top: 10px;
    }
}
</style>
